package group.raber.saber.jdbc;

import group.raber.saber.kit.SQLKit;
import group.raber.saber.lang.DataBox;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by tisir<yangsong158@qq.com> on 2017-05-28
 */
public class DataBoxRowMapper implements RowMapper<DataBox> {
    protected NameConverter nameConverter ;

    public DataBoxRowMapper(NameConverter nameConverter) {
        this.nameConverter = nameConverter;
    }

    public DataBox mapRow(ResultSet rs, int rowNum) throws SQLException {
        return SQLKit.getRowValue(rs,nameConverter);
    }
}
